﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Master/PopupDiv.master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="ECommerce.Web.ECAdmin.Member.Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <style type="text/css">
        .style1
        {
            width: 75px; height:30px; text-align:right;
        }  
        .style2
        {
            text-align:left; padding-left:10px;
        }     
    </style>
<script type="text/javascript">
//    $(function ()
//    {
//        var areaCode = '<% %>';

//        $.get("../../Common/Area.ashx", function (data)
//        {
//            eval("var areas=" + data + ";");

//            $("#province").get(0).options.add(new Option());
//            for (var i = 0; i < areas.length; i++)
//            {
//                var id = areas[i].ID + ""; //转成字符串                 
//                if (id.substr(2) == "0000")
//                {
//                    var opt = new Option();
//                    opt.text = areas[i].Name;
//                    opt.value = areas[i].ID;
//                    if (areaCode != "")
//                    {
//                        if (id.substr(0, 2) == areaCode.substr(0, 2))
//                        {
//                            opt.selected = "selected";
//                            setCity(areas, id.substr(0, 2), areaCode);
//                        }
//                    }
//                    $("#province").get(0).options.add(opt);
//                }

//            }

//            $("#province").change(function ()
//            {
//                var code = $(this).val().substr(0, 2);
//                setCity(areas, code);
//            });

//            $("#city").change(function ()
//            {
//                var code = $(this).val().substr(0, 4);
//                setArea(areas, code);
//            });


//        });

//    });

    //如果有areaCode，表示有初始化
    function setCity(areas, code, areaCode)
    {
        
        removeAll($("#city").get(0));
       
        removeAll($("#area").get(0));
       
        $("#city").get(0).options.add(new Option());
        for (var i = 0; i < areas.length; i++)
        {
            var id = areas[i].ID + ""; //转成字符串     
            if (id.substr(2) != "0000" & id.substr(4) == "00" && id.substr(0, 2) == code)
            {
                var opt = new Option();
                opt.text = areas[i].Name;
                opt.value = areas[i].ID;
                if (areaCode != null && areaCode != "")
                {
                    if (id.substr(0, 4) == areaCode.substr(0, 4))
                    {
                        opt.selected = "selected";
                        setArea(areas, id.substr(0, 4), areaCode);
                    }
                }
                $("#city").get(0).options.add(opt);
            }
        }
    }

    function setArea(areas, code, areaCode)
    {
        removeAll($("#area").get(0));
        $("#area").get(0).options.add(new Option());
        for (var i = 0; i < areas.length; i++)
        {
            var id = areas[i].ID + ""; //转成字符串     
            if (id.substr(4) != "00" && id.substr(0, 4) == code)
            {
                var opt = new Option();
                opt.text = areas[i].Name;
                opt.value = areas[i].ID;
                if (areaCode == id)
                {
                    opt.selected = "selected";
                }
                $("#area").get(0).options.add(opt);
            }
        }
    }

    function removeAll(sel)
    {
        
        
        if (sel == null)
            return;
        
        for (var i = 0; i < sel.options.length; )
        {
            
            sel.remove(0);
        }
    }
</script>
    <script src="../../Common/Js/Calendar.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Panel ID="pnlMain" runat="server" CssClass="pnlMain">
        <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
            <tr>
                <td class="style1">
                    <asp:Label ID="Label1" runat="server" Text="用户姓名："></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="Name" runat="server" Width="250px" CssClass="txt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <span style="color:Red">*</span>&nbsp;<asp:Label ID="Label4" runat="server" 
                        Text="登录名："></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="LoginName" runat="server" Width="250px" CssClass="txt"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="LoginName"
                        Display="None" ErrorMessage="请输入登录名" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <span style="color:Red">*</span>&nbsp;<asp:Label ID="Label6" runat="server" 
                        Text="密码："></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtPassword" runat="server" Width="250px" TextMode="Password" 
                        CssClass="txt"></asp:TextBox>
                    <asp:HiddenField ID="hidPassword" runat="server" />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="txtPassword" Display="None" ErrorMessage="密码不得低于六位" 
                        SetFocusOnError="True" ValidationExpression=".{6,}"></asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ControlToValidate="txtPassword" Display="None" ErrorMessage="密码不得低于六位" 
                        SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr >
                <td class="style1">
                    <span style="color:Red">*</span>&nbsp;<asp:Label ID="Label3" runat="server" 
                        Text="手机："></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="Mobile" runat="server" CssClass="txt" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <span style="color:Red">*</span>&nbsp;<asp:Label ID="Label5" runat="server" 
                        Text="电子邮件："></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="EMail" runat="server" Width="250px" CssClass="txt"></asp:TextBox>
                    
                </td>
            </tr>
            <tr>
                <td class="style1">性别：</td>
                <td class="style2">
                    <asp:DropDownList ID="drpGender" runat="server" Width="60px">
                    </asp:DropDownList>
                    生日：<asp:TextBox ID="Birthday" runat="server"  CssClass="txt" Width="149px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">详细地址：</td>
                <td class="style2">
                    <asp:TextBox ID="Street" runat="server" CssClass="txt" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">邮编：</td>
                <td class="style2">
                    <asp:TextBox ID="ZipCode" runat="server" CssClass="txt" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">状态：</td>
                <td class="style2">
                    <asp:DropDownList ID="State" runat="server">
                    </asp:DropDownList>
                    &nbsp;级别：<asp:DropDownList ID="Level" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>           
            <tr>
                <td class="style1">
                    <asp:Label ID="lblRem" runat="server" Text="账户余额："></asp:Label></td>
                <td class="style2">
                    <asp:Label ID="lblRemain" runat="server" Text="Label"></asp:Label></td>
            </tr>
        </table>
    </asp:Panel>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowSummary="False"
        ShowMessageBox="True"></asp:ValidationSummary>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="保存" />
</asp:Content>
